Skip to content

feat: partial-shift content handover (server)#1477

Merged
renemadsen merged 2 commits into
stablefrom
feat/partial-shift-handover
Apr 15, 2026
Merged

feat: partial-shift content handover (server)#1477
renemadsen merged 2 commits into
stablefrom
feat/partial-shift-handover

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

  • Workers with multiple planned shifts on a date can now hand over any subset independently; recipients accept or reject each shift on its own.
  • Proto adds repeated shift_indices to Create + eligibility and shift_index on the request model. CreateContentHandover keeps the singular ContentHandoverResponse shape plus a new repeated models field for wire-compat with older clients.
  • Service: per-shift validation, atomic all-or-nothing create, partial MoveContent touches only PlannedStart/End/Break{N} and recomputes PlanHours/IsDoubleShift via CalculatePauseAutoBreakCalculationActive. Duplicate-pending matrix blocks full-day↔partial overlap.
  • Push notification carries handoverRequestId (first id, singular — matches mobile FCM handler) and handoverRequestIds (CSV) for future batch-aware clients.
  • Bumps Microting.TimePlanningBase to 10.0.37 which adds the ShiftIndex column.

Test plan

  • CI green on .NET Build & Test.
  • Unit tests cover: single-shift create, multi-shift atomic rollback, accept one of N, accept-all-N equals full-day end state, reject one of N, duplicate-pending matrix (same shift blocked; different shift allowed; pending full-day blocks partial; pending partial blocks full-day), eligibility filter.
  • Manual gRPC probe via tool/probe_plannings.dart after Flutter client lands: login as gps@microting.com on 855, partial-handover 2 of 5 shifts to a coworker, accept one + reject other, verify planning state on both workers.

Follow-up (not in this PR)

  • Flutter/Dart client work (shift multi-select picker, transport plumbing, inbox grouping) per docs/purring-strolling-whistle-design.md style plan.

🤖 Generated with Claude Code

renemadsen and others added 2 commits April 15, 2026 16:21
Workers with multiple planned shifts on a date can now hand over any
subset independently instead of the whole day. Recipients accept or
reject each shift on its own.

- Proto: repeated shift_indices on Create + eligibility; shift_index on
  request model. CreateContentHandover response keeps singular shape
  (backwards-compatible) and adds a repeated models field.
- Service: per-shift validation, atomic all-or-nothing create, partial
  MoveContent that touches only the selected Shift{N} columns and
  recomputes PlanHours via CalculatePauseAutoBreakCalculationActive.
  Duplicate-pending matrix blocks full-day↔partial overlap.
- Eligibility: when shift_indices is non-empty, coworkers must have
  PlannedEndOfShift{N} == 0 for every listed N.
- Push: batched create notification carries handoverRequestId (first)
  and handoverRequestIds (CSV) for dual-key compatibility.
- Tests: single/multi-shift create, atomic rollback, accept one of N,
  accept-all-equivalence, reject one of N, duplicate-pending matrix,
  eligibility filter.
- Bumps Microting.TimePlanningBase to 10.0.37 (adds ShiftIndex column).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AcceptAsync hard-fails on the partial path when no AssignedSite exists
for source/target (safety net against silent derived-field corruption).
The new partial-shift tests did not seed these rows, so CI failed with
"AssignedSite missing for source worker". Seed both sites in the shared
SeedPartialShiftPairAsync helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@renemadsen renemadsen merged commit 3ff95a5 into stable Apr 15, 2026
20 checks passed
@renemadsen renemadsen deleted the feat/partial-shift-handover branch April 15, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant